﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Zcu.PanelComposer.Interfaces
{
    public interface IRepository : IDisposable
    {
        void Add<T>(T entity) where T : class;
        void Delete<T>(T entity) where T : class;
        void DeleteBeforeCommit<T>(T entity) where T : class;
        void DeleteAll<T>() where T : class;
        void Update<T>(T entity) where T : class;
        void Update<T>(T entity, T original) where T : class;
        void Commit();
        void RollBackAll();

        IList<T> GetAll<T>() where T : class;
        IList<T> GetAll<T>(Func<T, bool> condition) where T : class;
        T GetById<T>(Func<T, bool> condition) where T : class;
    }
}